package com.yunhe.util;

import com.yunhe.Service.UserService;
import com.yunhe.controller.UserController;
import com.yunhe.dao.UserDao;
import com.yunhe.javaBean.User;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserTest {
    static ClassPathXmlApplicationContext cpac = null;

    static {
        cpac = new ClassPathXmlApplicationContext("applicationContext.xml");
    }

//    @Test
//    public void usertest() {
//        UserController userController = new UserController();
//        userController.find();
//    }


    @Test
    public void userTest() {
        User user = (User) cpac.getBean("user");
        System.out.println(user);
    }

    @Test
    public void lifecycle() {
        cpac.close();
    }

@Test
    public void Test() {
//    UserService userService = (UserService) cpac.getBean("userService");
//    userService.selectAll();

       UserController userController  = (UserController) cpac.getBean("userController");
    userController.find();
    }
}
